﻿/*--------------------------------------------------------------
 * Author : Shine K Velayudhan 
 ---------------------------------------------------------------*/
using System.Collections.Generic;

namespace IQN.Logging
{
    public static class LogDataManager
    {
        public static void ClearAllLogs()
        {
            LogManager.TheLoggerTree.TraceLogCache.Clear();
            LogManager.TheLoggerTree.PerformanceLogCache.Clear();
            LogManager.TheLoggerTree.ErrorLogCache.Clear();
        }

        public static IEnumerable<ErrorMessage> ErrorMessages
        {
            get
            {
                return LogManager.TheLoggerTree.ErrorLogCache.GetSnapshotOfMessages();
            }
        }

        public static IEnumerable<PerformanceMessage> PerformanceMessages
        {
            get
            {
                return LogManager.TheLoggerTree.PerformanceLogCache.GetSnapshotOfMessages();
            }
        }

        public static IEnumerable<TraceMessage> TraceMessages
        {
            get
            {
                return LogManager.TheLoggerTree.TraceLogCache.GetSnapshotOfMessages();
            }
        }
    }
}
